import instance from './instance';
import { convertRESTAPI } from '../util';

/** 登录 */
function login_post (opts) {
    return instance({
        method: 'post',
        url:  '/portal/login',
        opts: opts
    });
}
/** 登录 */
function loginOut_post (opts) {
    return instance({
        method: 'post',
        url:  '/portal/loginOut',
        opts: opts
    });
}
/** 检测验证码 */
function captchaCheck_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/captchaCheck',
        opts: opts
    });
}
/** 注册 */
function regist_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/regist',
        opts: opts
    });
}
/** 检查信息有效性  */
function selectStudent_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/selectStudent',
        opts: opts
    });
}
/** 提交  */
function registSuccess_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/registSuccess',
        opts: opts
    });
}
function profileSuccess_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/profileSuccess',
        opts: opts
    });
}
/** 重新发送邮件 */
function resetSendMail_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/resetSendMail',
        opts: opts
    });
}
function sendEmail_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/sendEmail',
        opts: opts
    });
}

/** 验证邮件 */
function registAuth_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/registAuth',
        opts: opts
    });
}
/** 验证登录状态 */
function checkLogin_post(opts) {
    return instance({
        method: 'post',
        url:  '/portal/checkLogin',
        opts: opts
    });
}
function getVolByXc_post(opts) {
        return instance({
            method: 'post',
            url:  '/student/selectVolByXc',
            opts: opts
        });
}
function getVolByPm_post(opts) {
    return instance({
        method: 'post',
        url:  '/student/selectVolByPm',
        opts: opts
    });
}
function addCollection_post(opts){
    return instance({
        method: 'post',
        url:  '/Collection/addCollection',
        opts: opts
    });
}
function getVolByDiff_post(opts) {
    return instance({
        method: 'post',
        url:  '/student/selectVolByDiff',
        opts: opts
    });
}
function getVolByLb_post(opts) {
    return instance({
        method: 'post',
        url:  '/student/selectVolByLb',
        opts: opts
    });
}
function getSearch_post(opts) {
    return instance({
        method: 'post',
        url:  '/student/selectCateByType',
        opts: opts
    });
}
function getSearch1_post(opts) {
    return instance({
        method: 'post',
        url:  '/student/selectSubjecByCate',
        opts: opts
    });
}
function getInitZyByCate_post(opts) {
    return instance({
        method: 'post',
        url:  '/student/getInitZyByCate',
        opts: opts
    });
}
function getSearch2_post(opts) {
    return instance({
        method: 'post',
        url:  '/student/selectProfessionBySubject',
        opts: opts
    });
}
/** 示例 */
function getNews_get (opts) {
    return instance({
        method: 'get',
        url: '/getNews',
        opts: opts
    });
}

/** 示例 */
function getAllUser_get (opts) {
    return instance({
        method: 'get',
        url: '/getAllUser',
        opts: opts
    });
}
/** 查询志愿收藏表 */
function collectFindAll_post (opts) {
    return instance({
        method: 'post',
        url: '/Collection/selectCollection/',
        opts: opts
    });
}

/** 通过id查询志愿收藏表 */
function collectFindById_post (opts) {
    return instance({
        method: 'post',
        url: '/Collect/findById/',
        opts: opts
    });
}
/** 通过id查询学校 */
function introdectFindByid_post (opts) {
    return instance({
        method: 'post',
        url: '/introduct/findById',
        opts: opts
    });
}

/** 收藏+1 */
function addBrowseNumByid_post (opts) {
    return instance({
        method: 'post',
        url: '/count/addBrowseNum',
        opts: opts
    });
}


/** 通过学校id查询历史录取 */
function historyFindByid_post (opts) {
    return instance({
        method: 'post',
        url: '/history/findById',
        opts: opts
    });
}
 /** 通过学校id查询就业信息 */
function jobFindByid_post (opts) {
    return instance({
        method: 'post',
        url: '/job/findById',
        opts: opts
    });
}
/** 通过ids数组查询院校pk结果 */
function getPKresultByIds (opts) {
    return instance({
        method: 'post',
        url: '/pk/findById',
        opts: opts
    });
}
/** 查询竞争情报表 */
function findAll_intelligence (opts) {
    return instance({
        method: 'post',
        url: '/count/findCountByUserIdAndBatch',
        opts: opts
    });
}

/** 查询招生计划 */
function findAll_IntelligenceStudent (opts) {
    return instance({
        method: 'post',
        url: '/IntelligenceStudent/findAll',
        opts: opts
    });
}
/** 查询分数情报 */
function findAll_IntelligenceGrade (opts) {
    return instance({
        method: 'post',
        url: '/IntelligenceGrade/findAll',
        opts: opts
    });
}
/** 查询排名情报 */
function findAll_IntelligenceRanking(opts){
    return instance({
        method: 'post',
        url:  '/IntelligenceRanking/findAll',
        opts: opts
    });
}
/** 对手情报 */
function findAll_intelligenceOpponent(opts){
    return instance({
        method: 'get',
        url:  '/intelligenceOpponent/findAll',
        opts: opts
    });
}

/** 生成霍兰德性格职业测试题目 */
function getQuestion (opts) {
    return instance({
        method: 'post',
        url: '/test/getQuestion',
        opts: opts
    });
}

/** 将当前用户的测试得分和霍兰德代码录入数据库 */
function addResult (opts) {
    return instance({
        method: 'post',
        url: '/test/addResult',
        opts: opts
    });
}
/** 将当前用户的霍兰德代码查询对应的专业和职业 */
function getTest2jobByType (opts) {
    return instance({
        method: 'post',
        url: '/test/getTest2jobByType',
        opts: opts
    });
}
/** 将当前用户的ID查询霍兰德代码 */
function getTypeById (opts) {
    return instance({
        method: 'post',
        url: '/test/getTypeById',
        opts: opts
    });
}
/** 首页查询 */
function getStudentAll_get (opts) {
    return instance({
        method: 'get',
        url: '/student/findAll',
        opts: opts
    });
}
function getSchoolAllList_get (opts) {
    return instance({
        method: 'get',
        url: '/student/getSchoolAllList',
        opts: opts
    });
}

function getSameRankList_get (opts) {
    return instance({
        method: 'get',
        url: '/student/selectSameRankList',
        opts: opts
    });
}
export {
    login_post,
    getNews_get,
    getAllUser_get,
    collectFindAll_post,
    collectFindById_post,
    introdectFindByid_post,
    historyFindByid_post,
    jobFindByid_post,
    getPKresultByIds,
    findAll_intelligence,
    findAll_IntelligenceStudent,
    findAll_IntelligenceGrade,
    findAll_IntelligenceRanking,
    findAll_intelligenceOpponent,
    getQuestion,
    addResult,
    getTest2jobByType,
    getTypeById,
    captchaCheck_post,
    regist_post,
    resetSendMail_post,
    registAuth_post,
    selectStudent_post,
    registSuccess_post,
    addBrowseNumByid_post,
    getVolByXc_post,
    checkLogin_post,
    getStudentAll_get,
    getVolByPm_post,
    getVolByDiff_post,
    loginOut_post,
    getSearch_post,
    getSearch1_post,
    getSearch2_post,
    getSameRankList_get,
    getVolByLb_post,
    getInitZyByCate_post,
    getSchoolAllList_get,
    sendEmail_post,
    profileSuccess_post,
    addCollection_post
};
